home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / MetalworksInBox.java < prev    next >
Text File  |  1998-06-30  |  3KB  |  95 lines

  1. /*
  2.  * @(#)MetalworksInBox.java    1.1 98/02/05
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. import java.awt.*;
  22. import java.awt.event.*;
  23. import java.util.*;
  24. import com.sun.java.swing.*;
  25. import com.sun.java.swing.border.*;
  26. import com.sun.java.swing.tree.*;
  27.  
  28.  
  29. /**
  30.   * This is a subclass of JInternalFrame which displays a tree.
  31.   *
  32.   * @version 1.1 02/05/98
  33.   * @author Steve Wilson
  34.   */
  35. public class MetalworksInBox extends JInternalFrame {
  36.   
  37.     public MetalworksInBox() {
  38.     super("In Box", true, true, true, true);
  39.  
  40.     DefaultMutableTreeNode unread;
  41.     DefaultMutableTreeNode personal;
  42.     DefaultMutableTreeNode business;
  43.     DefaultMutableTreeNode spam;    
  44.  
  45.         DefaultMutableTreeNode top = new DefaultMutableTreeNode("Mail Boxes");
  46.  
  47.     top.add( unread = new DefaultMutableTreeNode("Unread Mail") );
  48.     top.add( personal = new DefaultMutableTreeNode("Personal") );
  49.     top.add( business = new DefaultMutableTreeNode("Business") );
  50.     top.add( spam = new DefaultMutableTreeNode("Spam") );
  51.  
  52.     unread.add( new DefaultMutableTreeNode("Buy Stuff Now") );
  53.     unread.add( new DefaultMutableTreeNode("Read Me Now") );
  54.     unread.add( new DefaultMutableTreeNode("Hot Offer") );
  55.     unread.add( new DefaultMutableTreeNode("Re: Re: Thank You") );
  56.     unread.add( new DefaultMutableTreeNode("Fwd: Good Joke") );
  57.  
  58.     personal.add( new DefaultMutableTreeNode("Hi") );
  59.     personal.add( new DefaultMutableTreeNode("Good to hear from you") );
  60.     personal.add( new DefaultMutableTreeNode("Re: Thank You") );
  61.  
  62.     business.add( new DefaultMutableTreeNode("Thanks for your order") );
  63.     business.add( new DefaultMutableTreeNode("Price Quote") );
  64.     business.add( new DefaultMutableTreeNode("Here is the invoice") );
  65.     business.add( new DefaultMutableTreeNode("Project Metal: delivered on time") );
  66.     business.add( new DefaultMutableTreeNode("Your salary raise approved") );
  67.  
  68.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  69.     spam.add( new DefaultMutableTreeNode("Make $$$ Now") );
  70.     spam.add( new DefaultMutableTreeNode("HOT HOT HOT") );
  71.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  72.     spam.add( new DefaultMutableTreeNode("Don't Miss This") );
  73.     spam.add( new DefaultMutableTreeNode("Opportunity in Precious Metals") );
  74.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  75.     spam.add( new DefaultMutableTreeNode("Last Chance") );
  76.     spam.add( new DefaultMutableTreeNode("Buy Now") );
  77.     spam.add( new DefaultMutableTreeNode("Make $$$ Now") );
  78.     spam.add( new DefaultMutableTreeNode("To Hot To Handle") );
  79.     spam.add( new DefaultMutableTreeNode("I'm waiting for your call") );
  80.  
  81.     JTree tree = new JTree(top);
  82.     JScrollPane treeScroller = new JScrollPane(tree);
  83.     treeScroller.setBackground(tree.getBackground());
  84.     setContentPane(treeScroller);
  85.     setSize( 325, 200);
  86.     setLocation( 75, 75);
  87.  
  88.     }
  89.  
  90.  
  91.  
  92. }
  93.  
  94.  
  95.